package Homework_java02;
import java.util.Random;
public class Copy_The_Array {
	public static int[] copyarr(int []a, int[] a1){
		Random r=new Random();
		int[] arr3=new int[a.length];
		for(int i=0;i<a.length;i++){
			int x=r.nextInt(2);
			if(x==0){
				arr3[i]=a[i];
			}else{
				arr3[i]=a1[i];
			}
		}
		
		return arr3;
	} 
	public static void main(String[] asgr){
		int[] arr={1,2,3,4,5};
		int[] arr1={6,7,8,9,10};
		int[] result= copyarr(arr,arr1);
		for(int i=0;i<result.length;i++){
			System.out.println(result[i]);
		}
		
	}

}
